package com.whnk.web.controller.report;

import java.util.ArrayList;
import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.whnk.report.domain.WorkData;

@Controller
@RequestMapping("/report/demo")
public class WorkController {
	private String prefix = "report/demo";
	
	@RequiresPermissions("report:demo:view")
	@GetMapping()
	public String demo()
	{
	    return prefix + "/demo";
	}
	
	@PostMapping("/workCount")
    @ResponseBody
    public List<WorkData> workCount(HttpServletRequest request, HttpServletResponse response) {
        List<WorkData> list = new ArrayList<WorkData>();
        list.add(new WorkData("35", "25"));
        list.add(new WorkData("10", "30"));
        list.add(new WorkData("33", "63"));
        list.add(new WorkData("88", "28"));
        list.add(new WorkData("12", "62"));
        list.add(new WorkData("22", "35"));
        return list;
    }
}
